﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MainPage.master" AutoEventWireup="false" CodeFile="ProfileEditProfile.aspx.vb" Inherits="ProfileEditProfile" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<fieldset>
<legend>Profile Details</legend>
<ul>
<li>
    <asp:Label ID="lblFname" runat="server" Text="First Name:"></asp:Label>
    <asp:TextBox ID="txtFname" runat="server"></asp:TextBox>
</li>

<li>
<asp:Label ID="lblLname" runat="server" Text="Last Name:"></asp:Label>
    <asp:TextBox ID="txtLname" runat="server"></asp:TextBox>
</li>

<li>
<asp:Label ID="lblNeighbor" runat="server" Text="Neighbor:"></asp:Label>
    <asp:TextBox ID="txtNeighbor" runat="server"></asp:TextBox>
</li>

<li>
<asp:Label ID="lblAvatar" runat="server" Text="Avatar:"></asp:Label>    
</li>
<li>
<asp:FileUpload ID="FileUpload1" runat="server" />
</li>
<li>
<asp:Button ID="btnProfile" runat="server" Text="Save Profile" />
</li>

</ul>
    
</fieldset>
<br />
<fieldset>
<legend>Test</legend>
    <asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="DSProfile" 
        Height="50px" Width="125px">
    </asp:DetailsView>
    <asp:SqlDataSource ID="DSProfile" runat="server" 
        ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
        ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
        SelectCommand="SELECT DISTINCT * FROM [tblProfile] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="1" Name="ID" QueryStringField="ID" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
</fieldset>
<br />
<fieldset>
<legend>test3</legend>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
        DataSourceID="AccessDataSource1" EmptyDataText="There are no data records to display.">
        <Columns>
            <asp:CommandField ShowEditButton="True" />
            <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" SortExpression="ID" />
            <asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />
            <asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />
            <asp:BoundField DataField="Neighbor" HeaderText="Neighbor" SortExpression="Neighbor" />
            <asp:BoundField DataField="SubmitteDate" HeaderText="SubmitteDate" SortExpression="SubmitteDate" />
            <asp:BoundField DataField="Avatar" HeaderText="Avatar" SortExpression="Avatar" />
        </Columns>
    </asp:GridView>
    <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="App_Data\WatchGroup.accdb"
        DeleteCommand="DELETE FROM `tblProfile` WHERE `ID` = ?" InsertCommand="INSERT INTO `tblProfile` (`ID`, `FirstName`, `LastName`, `Neighbor`, `SubmitteDate`, `Avatar`) VALUES (?, ?, ?, ?, ?, ?)"
        SelectCommand="SELECT `ID`, `FirstName`, `LastName`, `Neighbor`, `SubmitteDate`, `Avatar` FROM `tblProfile`"
        UpdateCommand="UPDATE `tblProfile` SET `FirstName` = ?, `LastName` = ?, `Neighbor` = ?, `SubmitteDate` = ?, `Avatar` = ? WHERE `ID` = ?">
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="ID" Type="Int32" />
            <asp:Parameter Name="FirstName" Type="String" />
            <asp:Parameter Name="LastName" Type="String" />
            <asp:Parameter Name="Neighbor" Type="String" />
            <asp:Parameter Name="SubmitteDate" Type="String" />
            <asp:Parameter Name="Avatar" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="FirstName" Type="String" />
            <asp:Parameter Name="LastName" Type="String" />
            <asp:Parameter Name="Neighbor" Type="String" />
            <asp:Parameter Name="SubmitteDate" Type="String" />
            <asp:Parameter Name="Avatar" Type="String" />
            <asp:Parameter Name="ID" Type="Int32" />
        </UpdateParameters>
    </asp:AccessDataSource>
</fieldset>
</asp:Content>

